public <T> T findFirstAfter(Class<T> c, String[] props, Object[] values, String limitProp, Date limit){
	Session session = getLocalSession();		
	Criteria cr = session.createCriteria(c);
	for(int i = 0; i<pnList.length; i++){
		cr.add(Restrictions.eq(props[i], values[i]));
	}
	cr.add(Restrictions.gt(limitProp, limit))
	cr.setProjection(Projections.min(limitProp));
	Date first = (Date)cr.uniqueResult();
	cr = session.createCriteria(c);
	for(int i = 0; i<pnList.length; i++){
		cr.add(Restrictions.eq(props[i], values[i]));
	}
	cr.add(Restrictions.eq(limitProp, limit));
	List<UserSession> result = cr.list();
	if(result.size() == 0)
		return null;			
	return result.get(0);		
}